<template>
  <div class="loginbody">
    <div>
      <label>用户名</label>
      <input class="form-input" ref="username" v-model="userData.username" type="text" placeholder="请输入用户名">
    </div>
    <div>
      <label>密码</label>
      <input type="password" ref="password1" v-model="userData.password1" placeholder="请输入登录密码" class="form-input">
    </div>
  </div>
</template>

<script>
import {mapState} from 'vuex'

export default {
  name: "Login",
  data() {
    return ({})
  },
  methods: {},
  computed: {
    ...mapState('Account', ['userData'])
  }
}
</script>

<style scoped lang="less">
//注册的主体
.registerbody {
  width: 100%;
  height: 57%;

  div {
    position: relative;
    width: 100%;
    height: 40px;
    margin-bottom: 20px;
    padding-bottom: 5px;

    label {
      box-sizing: border-box;
      height: 100%;
      width: 82px;
      color: #333333;
      font-weight: 200;
      display: block;
      float: left;
      padding-top: 6px;
    }

    .form-input {
      box-sizing: border-box;
      height: 100%;
      width: 340px;
      padding: 10px;
      margin: 1px;
      display: block;
      border-radius: 5px;
      border: 1px #ffffff solid;
      transition: all 0.3ms;

      &:focus {
        border: 2px orange solid;
      }
    }

    .errors {
      position: absolute;
      left: 82px;
      font-size: 13px;
      color: red;
      margin-top: 3px;
    }

    //密码提示感叹号
    .password-hint {
      height: 17px;
      position: absolute;
      left: 396px;
      top: 13px;
      color: #fc0000;
    }

    //验证码
    .code {
    @extend . form-input;
      width: 200px;
    }

    //验证码图片
    .code-img {
      position: relative;
      left: 300px;
      top: -41px;
      height: 40px;
      width: 120px;
    }

    button {
      padding: 0;
      border: 0;
    }
  }
}

//登录的主体
.loginbody {
  .registerbody();
  height: 45%;
  display: flex;
  flex-direction: column;
  justify-content: center;

  div {
    margin-bottom: 20px;
  }
}
</style>